#!/bin/bash

if pgrep -x connman-gtk; then

   if wmctrl -l | grep -i "Network Settings" ; then
      wmctrl -a "Network Settings"
      fbstartupnotify false
   else
      gtkdialog -t "Already running" -m "The Network Manager is already running.
To access its window, double-click the icon that resembles two
computers, located at the bottom right corner of the screen" -y OK
   fi
else
   exec connman-gtk
fi